import request from '@/utils/request'
import type { TrademarkResponseData, Trademark } from './type'
enum API {
  TRADMARK_URL = '/admin/product/baseTrademark/',
  ADDTRADMARK_URL = '/admin/product/baseTrademark/save',
  EDITTRADMARK_URL = '/admin/product/baseTrademark/update',
  DELETETRADMARK_URL = '/admin/product/baseTrademark/remove/'
}
export const reqHasTrademark = (page: number, limit: number) => request.get<any, TrademarkResponseData>(API.TRADMARK_URL + `${page}/${limit}`)
export const reqAddOrUpdateTrademark = (data: Trademark) => {
  if (data.id) {
    return request.put<any, any>(API.EDITTRADMARK_URL, data)
  } else {
    return request.post<any, any>(API.ADDTRADMARK_URL, data)
  }
}
export const reqDeleteTrademark = (id: number) => request.delete<any, any>(API.DELETETRADMARK_URL + id)